﻿// Ŭnicode please
#include "StdAfx.h"
#include "test.h"
#include "SRScene.h"

using namespace sora;

TEST(Transformation, Translate)
{
	Transformation t(TransformationTypeTranslate, 1, 2, 3);
	EXPECT_EQ(1, t.translateX());
	EXPECT_EQ(2, t.translateY());
	EXPECT_EQ(3, t.translateZ());

	t = Transformation::translate(1, 2, 3);
	EXPECT_EQ(1, t.translateX());
	EXPECT_EQ(2, t.translateY());
	EXPECT_EQ(3, t.translateZ());
}
TEST(Transformation, Scale)
{
	Transformation t(TransformationTypeScale, 1, 2, 3);
	EXPECT_EQ(1, t.scaleX());
	EXPECT_EQ(2, t.scaleY());
	EXPECT_EQ(3, t.scaleZ());

	t = Transformation::scale(1, 2, 3);
	EXPECT_EQ(1, t.scaleX());
	EXPECT_EQ(2, t.scaleY());
	EXPECT_EQ(3, t.scaleZ());

	t = Transformation::scale(2);
	EXPECT_EQ(2, t.scaleX());
	EXPECT_EQ(2, t.scaleY());
	EXPECT_EQ(2, t.scaleZ());
}
TEST(Transformation, Rotate)
{
	Transformation t = Transformation::rotate(34, 41, 45);
	EXPECT_EQ(34, t.rotateX());
	EXPECT_EQ(41, t.rotateY());
	EXPECT_EQ(45, t.rotateZ());

	//각도가 0~360을 벗어난 경우, 안쪽으로 보정하기
	t = Transformation::rotate(-60, 720, 390);
	EXPECT_EQ(300, t.rotateX());
	EXPECT_EQ(0, t.rotateY());
	EXPECT_EQ(30, t.rotateZ());
}